<template>
  <Tree ref="mTree" :data="menuList" @on-select-change="handleClick"></Tree>
</template>
<script>
export default {
  name: 'menuTree',
  props: {
    menuList: Array
  },
  methods: {
    handleClick () {
      let checkedNode = this.$refs.mTree.getSelectedNodes();
      // 给父组件传递选中的菜单node
      this.$emit('menuIdChanged', checkedNode[0]);
    }
  }
}
</script>
